import { Select } from 'antd';
const { Option } = Select;

type SelectList = { [key: string]: any };
/**
 * 动态生成下拉框
 * @param list 全部的列表
 * @param valN key 值
 * @param name 显示的名称
 * @returns
 */
export const selectOption = (
  list: SelectList[],
  valN: string,
  name: string,
) => {
  return list.map((item: any) => (
    <Option key={item[valN]} value={item[valN]}>
      {item[name]}
    </Option>
  ));
};
